//
//  MVPView.m
//  架构
//
//  Created by 王玉东 on 2018/10/10.
//  Copyright © 2018 WYD. All rights reserved.
//

#import "MVPView.h"

@interface MVPView()
@property(nonatomic,strong)UILabel *lbContent;
@property(nonatomic,strong)UIButton *button;
@end



@implementation MVPView

-(instancetype) init{
    
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor lightGrayColor];
        self.lbContent = [[UILabel alloc]init];
        [self addSubview:self.lbContent];
        _lbContent.frame = CGRectMake(0, 100, 300, 30);
        _lbContent.textAlignment = NSTextAlignmentCenter;
        _lbContent.textColor = [UIColor blackColor];
        
        self.button = [UIButton new];
        self.button.frame = CGRectMake(100, 200, 60, 30);
        [self addSubview:self.button];
        [self.button setTitle:@"print" forState:UIControlStateNormal];
        [self.button addTarget:self action:@selector(clickbutton) forControlEvents:UIControlEventTouchUpInside];
        
    }
    
    return self;
}
-(void)printOnview:(NSString *)content{
    
    [_lbContent setText:content];
    
}
-(void)clickbutton{
    
    if(_delegate){
        
        [self.delegate onprintBtnclick];
        
        
    }
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
